<template>
    <div class="container">
        <div class="logo">
            <img src="../assets/bodalogo.png" style="height: 52px;float: left">

            <a href="../../public/index.html"><img src="../assets/index.png" style="height: 52px;float: left">
            </a>
        </div>
        <div class="left_open" style="float: left">
            <a><i title="展开左侧栏" class="iconfont">&#xe699;</i></a>
        </div>
        <ul class="layui-nav left fast-add" lay-filter="">
            <li class="layui-nav-item">
                <a href="javascript:;">+新增</a>
                <dl class="layui-nav-child">
                    <!-- 二级菜单 -->
                    <dd>
                        <a onclick="xadmin.open('最大化','http://www.baidu.com','','',true)">
                            <i class="iconfont">&#xe6a2;</i>弹出最大化</a></dd>
                    <dd>
                        <a onclick="xadmin.open('弹出自动宽高','http://www.baidu.com')">
                            <i class="iconfont">&#xe6a8;</i>弹出自动宽高</a></dd>
                    <dd>
                        <a onclick="xadmin.open('弹出指定宽高','http://www.baidu.com',500,300)">
                            <i class="iconfont">&#xe6a8;</i>弹出指定宽高</a></dd>
                    <dd>
                        <a onclick="xadmin.add_tab('在tab打开','member-list.html')">
                            <i class="iconfont">&#xe6b8;</i>在tab打开</a></dd>
                    <dd>
                        <a onclick="xadmin.add_tab('在tab打开刷新','member-del.html',true)">
                            <i class="iconfont">&#xe6b8;</i>在tab打开刷新</a></dd>
                </dl>
            </li>
        </ul>
        <ul class="layui-nav right" lay-filter="">
            <li class="layui-nav-item">
                <a href="javascript:;"><span>当前用户</span><span style="font-size: 28px">{{this.currnetname}}</span></a>
                <dl class="layui-nav-child">
                    <!-- 二级菜单 -->
                    <dd>
                        <a @click="logout">切换帐号</a>
                    </dd>
                    <dd>
                        <a @click="logout">退出</a>
                    </dd>
                </dl>
            </li>
        </ul>
    </div>
</template>

<script>
    import { mapActions, mapState } from "vuex";
    export default {
        data(){
            return{
                currnetname:""
            }
        },
        created(){
            this.currnetname = sessionStorage.getItem("username")
        },
        name: "topheader",
        methods:{
            logout(){
                this.oplogout();
            },
            ...mapActions(["oplogout","updateOPInfo"])
        },
        computed:{
            ...mapState({
                opInfo:state=>state.opInfo,
            })
        },
    }
</script>

<style scoped>

</style>